<template>
  <div class="steps">
    <el-steps
      :active="1"
      :space="250"
      class="el-steps"
      finish-status="success"
      align-center
    >
      <el-step title="Done" />
      <el-step title="Processing" />
      <el-step title="Step 3" />
      <el-step title="Step 4" />
    </el-steps>
  </div>
  <el-form
    ref="ruleFormRef"
    :model="ruleForm"
    :rules="rules"
    class="demo-ruleForm"
    label-position="right"
    label-width="100px"
    status-icon
  >
    <el-form-item label="商品分类：" prop="region">
      <el-select v-model="ruleForm.region" placeholder="Activity zone">
        <el-option label="Zone one" value="shanghai" />
        <el-option label="Zone two" value="beijing" />
      </el-select>
    </el-form-item>

    <el-form-item label="商品名称：" prop="name">
      <el-input />
    </el-form-item>
    <el-form-item label="副标题：" prop="name">
      <el-input />
    </el-form-item>
    <el-form-item label="商品品牌：" prop="region">
      <el-select v-model="ruleForm.region" placeholder="Activity zone">
        <el-option label="Zone one" value="shanghai" />
        <el-option label="Zone two" value="beijing" />
      </el-select>
    </el-form-item>
    <el-form-item label="商品介绍：">
      <el-input :rows="2" type="textarea" placeholder="请输入内容" />
    </el-form-item>
    <el-form-item label="商品货号：">
      <el-input />
    </el-form-item>
    <el-form-item label="商品售价：">
      <el-input placeholder="0" />
    </el-form-item>
    <el-form-item label="市场价：">
      <el-input placeholder="0" />
    </el-form-item>
    <el-form-item label="商品库存：">
      <el-input placeholder="0" />
    </el-form-item>
    <el-form-item label="计量单位：">
      <el-input />
    </el-form-item>
    <el-form-item label="商品重量：">
      <div class="ipt"><el-input placeholder="0" /> <span>克</span></div>
    </el-form-item>
  </el-form>
</template>

<script lang="ts" setup>
import { reactive, toRefs, ref } from "vue";
import type { FormInstance, FormRules } from "element-plus";

const formLabelWidth = "500px";

const ruleFormRef = ref<FormInstance>();
const ruleForm = reactive({
  name: "Hello",
  region: "",
  count: "",
  date1: "",
  date2: "",
  delivery: false,
  type: [],
  resource: "",
  desc: "",
});

const rules = reactive<FormRules>({
  name: [
    { required: true, message: "Please input Activity name", trigger: "blur" },
    { min: 3, max: 5, message: "Length should be 3 to 5", trigger: "blur" },
  ],
  region: [
    {
      required: true,
      message: "Please select Activity zone",
      trigger: "change",
    },
  ],
});
</script>
<style lang="less" scoped>
.steps {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 60px;
  .el-steps {
    width: 1000px;
    // margin: 0 auto;
  }
}

.demo-ruleForm {
  width: 700px;
  // height: 1000px;
  // background-color: red;
  margin: 0 auto;
}

.ipt {
  display: flex;
}
</style>
